﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ThanhTu.GNC.Media.KQXS.DataAccess.DAL;
using ThanhTu.GNC.Media.KQXS.DataAccess.DO;
using System.Data;

namespace ThanhTu.GNC.Media.KQXS.DataAccess.BL
{
    public class MessengerSyntaxBL : IDisposable
    {
        private MessengerSyntaxDAL vMessengerSyntaxDAL = null;
        private bool disposed = false;
        public MessengerSyntaxBL()
        {
            if (vMessengerSyntaxDAL == null)
            {
                vMessengerSyntaxDAL = new MessengerSyntaxDAL();
            }
        }
        ~MessengerSyntaxBL() { Dispose(false); }

        #region IDisposable Members

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        private void Dispose(bool disposing)
        {
            if (!disposed)
            {
                if (disposing)
                {
                    if (vMessengerSyntaxDAL != null)
                    {
                        vMessengerSyntaxDAL.Dispose();
                        vMessengerSyntaxDAL = null;
                    }
                }

                disposed = true;
            }
        }

        #endregion

        public int SaveMess(MessengerSyntaxDO vMessengerSyntaxDO) { return vMessengerSyntaxDAL.SaveMess(vMessengerSyntaxDO); }
        public int UpdateMess(MessengerSyntaxDO vMessengerSyntaxDO) { return vMessengerSyntaxDAL.UpdateMess(vMessengerSyntaxDO); }
        public int delete(string ProvinceID, string SWITCH_BOARD) { return vMessengerSyntaxDAL.delete(ProvinceID, SWITCH_BOARD); }
        public MessengerSyntaxDO GetByMessSyntax(string Province_ID, string SWITCH_BOARD) { return vMessengerSyntaxDAL.GetByMessSyntax(Province_ID, SWITCH_BOARD); }
        public MessengerSyntaxDO GetByMessSyntax_Syntax(string Syntax, string SWITCH_BOARD) { return vMessengerSyntaxDAL.GetByMessSyntax_Syntax(Syntax, SWITCH_BOARD); }
        public DataTable SelectAll_Messenger(int pageIndex, int pageSize, ref int rowCount) { return vMessengerSyntaxDAL.SelectAll_Messenger(pageIndex, pageSize, ref  rowCount); }
        public DataTable SelectAll_Messenger_Region(string Region_id, int pageIndex, int pageSize, ref int rowCount) { return vMessengerSyntaxDAL.SelectAll_Messenger_Region(Region_id, pageIndex, pageSize, ref  rowCount); }
    }
}
